<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>bonobo-storage</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Libbonobo Reference Manual">
<link rel="up" href="streams.html" title="Storages and Streams">
<link rel="prev" href="libbonobo-bonobo-stream-memory.html" title="BonoboStreamMem">
<link rel="next" href="libbonobo-bonobo-stream-client.html" title="bonobo-stream-client">
<meta name="generator" content="GTK-Doc V1.15.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libbonobo-bonobo-stream-memory.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="streams.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Libbonobo Reference Manual</th>
<td><a accesskey="n" href="libbonobo-bonobo-stream-client.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libbonobo-bonobo-storage.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#libbonobo-bonobo-storage.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="libbonobo-bonobo-storage"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libbonobo-bonobo-storage.top_of_page"></a>bonobo-storage</span></h2>
<p>bonobo-storage — Abstract implementation of the Bonobo::Storage interface</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="libbonobo-bonobo-storage.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis"><span class="returnvalue">void</span>                <a class="link" href="libbonobo-bonobo-storage.html#bonobo-storage-copy-to" title="bonobo_storage_copy_to ()">bonobo_storage_copy_to</a>              (<em class="parameter"><code><span class="type">Bonobo_Storage</span> src</code></em>,
                                                         <em class="parameter"><code><span class="type">Bonobo_Storage</span> dest</code></em>,
                                                         <em class="parameter"><code><span class="type">CORBA_Environment</span> *ev</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-storage.description"></a><h2>Description</h2>
<p>
The BonoboStorage C interface is extremely simple, this is since
the CORBA client interface is where the action occurs. It is
anticipated that relatively few people need to implement the
Bonobo/Storage IDL interface.
</p>
<p>
The common entry point for BonoboStorage is that of opening a
storage using the bonobo_storage_open function, perhaps by a
container to use to persist a compound document:
  </p>
<div class="example">
<a name="id3175112"></a><p class="title"><b>Example 23. An example storage use case</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="type">void</span>
<span class="function">container_save</span><span class="normal"> </span><span class="symbol">(</span><span class="usertype">SampleApp</span><span class="normal">         </span><span class="symbol">*</span><span class="normal">app</span><span class="symbol">,</span>
<span class="normal">                </span><span class="keyword">const</span><span class="normal"> </span><span class="type">char</span><span class="normal">        </span><span class="symbol">*</span><span class="normal">filename</span><span class="symbol">,</span>
<span class="normal">                </span><span class="usertype">CORBA_Environment</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">ev</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">    </span><span class="usertype">BonoboStorage</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">storage</span><span class="symbol">;</span>
<span class="normal">    </span><span class="usertype">Bonobo_Storage</span><span class="normal"> corba_storage</span><span class="symbol">;</span>
<span class="normal">    </span><span class="usertype">GList</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">components</span><span class="symbol">;</span>
<span class="normal">    </span><span class="type">int</span><span class="normal"> i</span><span class="symbol">;</span>
<span class="normal">    storage </span><span class="symbol">=</span><span class="normal"> </span><span class="function">bonobo_storage_open</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">STORAGE_TYPE</span><span class="symbol">,</span><span class="normal"> filename</span><span class="symbol">,</span>
<span class="normal">                       Bonobo_Storage_READ </span><span class="symbol">|</span>
<span class="normal">                       Bonobo_Storage_WRITE </span><span class="symbol">|</span>
<span class="normal">                       Bonobo_Storage_CREATE</span><span class="symbol">,</span>
<span class="normal">                       </span><span class="number">0664</span><span class="symbol">);</span>
<span class="normal">    </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-return-if-fail">g_return_if_fail</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">storage</span><span class="symbol">);</span>
<span class="normal">    corba_storage </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="libbonobo-bonobo-object.html#BONOBO-OBJREF:CAPS">BONOBO_OBJREF</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">storage</span><span class="symbol">);</span>
<span class="normal">    </span><span class="symbol">...</span>
<span class="normal">    Serialize components to streams created in the storage</span>
<span class="normal">    </span><span class="symbol">...</span>
<span class="normal">    </span><span class="function">Bonobo_Storage_commit</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">corba_storage</span><span class="symbol">,</span><span class="normal"> ev</span><span class="symbol">);</span>
<span class="normal">    </span><span class="function">CORBA_exception_free</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">ev</span><span class="symbol">);</span>
<span class="normal">    </span><span class="function"><a href="libbonobo-bonobo-object.html#bonobo-object-unref">bonobo_object_unref</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">BONOBO_OBJECT</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">storage</span><span class="symbol">));</span>
<span class="cbracket">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<p><br class="example-break">
</p>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-storage.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="bonobo-storage-copy-to"></a><h3>bonobo_storage_copy_to ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                bonobo_storage_copy_to              (<em class="parameter"><code><span class="type">Bonobo_Storage</span> src</code></em>,
                                                         <em class="parameter"><code><span class="type">Bonobo_Storage</span> dest</code></em>,
                                                         <em class="parameter"><code><span class="type">CORBA_Environment</span> *ev</code></em>);</pre>
<p>
Implements a pure CORBA method for copying one storage into
another, this is used by several BonoboStorage implemetations
where a fast case localy copy cannot work.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
<td>the source storage
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dest</code></em> :</span></p></td>
<td>the destination storage
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>ev</code></em> :</span></p></td>
<td>CORBA exception environment
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="libbonobo-bonobo-storage.see-also"></a><h2>See Also</h2>
<p>
<a class="link" href="libbonobo-bonobo-persist.html#BonoboPersist"><span class="type">BonoboPersist</span></a> <a class="link" href="libbonobo-bonobo-persist-stream.html#BonoboPersistStream"><span class="type">BonoboPersistStream</span></a>
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15.1</div>
</body>
</html>